import request from '@/utils/request';
import type { AxiosPromise } from 'axios';
import type { CartDataVo, CartForm, CartVO } from '@/api/home/cart/types';

/**
 * 根据用户ID查询购物车列表
 * @param id
 * @param query
 * @returns {*}
 */

export const userIdListApi = (id: string | number, query: any): AxiosPromise<CartDataVo[]> => {
  return request({
    url: `/api/user/order/cart/list/${id}`,
    method: 'get',
    params: query
  });
};

/**
 * 添加购物车
 * @param data
 */
export const addCartApi = (data: CartForm) => {
  return request({
    url: '/api/user/order/cart/add',
    method: 'post',
    data: data
  });
};

/**
 * 删除购物车商品
 * @param id
 */
// export const delGoodsSkus = (id: string | number | Array<string | number>) => {
//   return request({
//     url: '/mall/goodsSkus/' + id,
//     method: 'delete'
//   });
// };
